package com.hekang.fragmentdemo;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;

public class FragmentValueActivity extends AppCompatActivity implements IButton {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_fragment_value);
        //加载Fragment
        getSupportFragmentManager().beginTransaction().add(R.id.container, new FragmentValues1()).commit();
    }

    @Override
    public void onFragmentBtnClick(String text) {
        //获取4
        FragmentValues4 fragmentValues4 = (FragmentValues4) getSupportFragmentManager().findFragmentById(R.id.fragmnet4);
        fragmentValues4.setFragmentTextView(text);
    }
}
